import Vue from "vue"
import Vuex from "vuex"
import { mutations } from "./mutations.js"
import { getters } from "./getters.js"
import { actions } from "./actions.js"

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		song: uni.getStorageSync("song") || {}, //当前播放的歌曲
		play: false, //歌曲是否在播放
		list: uni.getStorageSync("list") || [], //播放列表
		index: 0, //当前播放音乐的索引值
		time: 0,
	},
	mutations,
	getters,
	actions
})
export default store;
